package com.hcinfos.gsoo.view;

import com.hcinfos.gsoo.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class StartTimeItemLayout extends RelativeLayout implements
		OnClickListener {

	private Context context;
	private TextView shop_title;
	private CheckBox isCheck;

	public StartTimeItemLayout(Context context) {
		super(context);
		this.context = context;
		initLayout();
	}

	private void initLayout() {

		LayoutInflater lif = LayoutInflater.from(context);
		View view = lif.inflate(R.layout.starttime_item, null);
		view.setOnClickListener(this);
		shop_title = (TextView) view.findViewById(R.id.shop_title);
		isCheck = (CheckBox) view.findViewById(R.id.isCheck);
		addView(view);
	}

	public void setValue(String value) {
		shop_title.setText(value);
	}

	public boolean isCheckValue() {
		return isCheck.isChecked();
	}

	public String getValue() {
		return shop_title.getText().toString();
	}

	@Override
	public void onClick(View v) {

		isCheck.setChecked(!isCheck.isChecked());
	}

}
